// JavaScript Document
function add_new_CIFTYPE(){
		var vCIFTYPE = document.getElementById('tmpCIFTYPE').value;	
		var CIFTYPElist = document.getElementById('CIFTYPE').value;
		var CIFTYPE_arr = CIFTYPElist.split('-');
		var stringCIFTYPE='';
		var num=0;
		for(i in CIFTYPE_arr){
			if (CIFTYPE_arr[i]==vCIFTYPE){
				num=1;
				break;
			}
		}
		if(num==0){
			stringCIFTYPE = vCIFTYPE;
			document.getElementById('CIFTYPE').value = document.getElementById('CIFTYPE').value + stringCIFTYPE +"-";
		}
	}
	
	function delete_CIFTYPE(){
		var i;
		var num=0;
		var vCIFTYPE = document.getElementById('tmpCIFTYPE').value;
		var CIFTYPElist = document.getElementById('CIFTYPE').value;
		var CIFTYPE_arr = CIFTYPElist.split('-');
		if(CIFTYPElist.replace('-','')==vCIFTYPE){
			document.getElementById('CIFTYPE').value='';
			num=1;
		}
		if(num==0){
			for(i in CIFTYPE_arr){
				if(CIFTYPE_arr[i]==vCIFTYPE){	
					CIFTYPElist = CIFTYPElist.replace(vCIFTYPE+'-','');
				}
			}
			document.getElementById('CIFTYPE').value = CIFTYPElist;
		}
	}
	
	function check_soky(){
		var vTERMNO = document.getElementById('TERMNO').value;	
		if(vTERMNO < 6){
			if(vTERMNO==0 || vTERMNO==''){
				document.getElementById('CURMIN1').readOnly='readOnly';
				document.getElementById('INTRATE1').readOnly='readOnly';
				document.getElementById('INTCODE1').readOnly='readOnly';
				document.getElementById('PRDCODE1').readOnly='readOnly';
				
				document.getElementById('CURMIN2').readOnly='readOnly';
				document.getElementById('INTRATE2').readOnly='readOnly';
				document.getElementById('INTCODE2').readOnly='readOnly';
				document.getElementById('PRDCODE2').readOnly='readOnly';
				
				document.getElementById('CURMIN3').readOnly='readOnly';
				document.getElementById('INTRATE3').readOnly='readOnly';
				document.getElementById('INTCODE3').readOnly='readOnly';
				document.getElementById('PRDCODE3').readOnly='readOnly';
				
				document.getElementById('CURMIN4').readOnly='readOnly';
				document.getElementById('INTRATE4').readOnly='readOnly';
				document.getElementById('INTCODE4').readOnly='readOnly';
				document.getElementById('PRDCODE4').readOnly='readOnly';
				
				document.getElementById('CURMIN5').readOnly='readOnly';
				document.getElementById('INTRATE5').readOnly='readOnly';
				document.getElementById('INTCODE5').readOnly='readOnly';
				document.getElementById('PRDCODE5').readOnly='readOnly';
				
				//
				document.getElementById('CURMIN1').value='';
				document.getElementById('INTRATE1').value='';
				document.getElementById('INTCODE1').value='';
				document.getElementById('PRDCODE1').value='';
				
				document.getElementById('CURMIN2').value='';
				document.getElementById('INTRATE2').value='';
				document.getElementById('INTCODE2').value='';
				document.getElementById('PRDCODE2').value='';
				
				document.getElementById('CURMIN3').value='';
				document.getElementById('INTRATE3').value='';
				document.getElementById('INTCODE3').value='';
				document.getElementById('PRDCODE3').value='';
				
				document.getElementById('CURMIN4').value='';
				document.getElementById('INTRATE4').value='';
				document.getElementById('INTCODE4').value='';
				document.getElementById('PRDCODE4').value='';
				
				document.getElementById('CURMIN5').value='';
				document.getElementById('INTRATE5').value='';
				document.getElementById('INTCODE5').value='';
				document.getElementById('PRDCODE5').value='';
				//
				
				document.tongquat.find1.disabled=true;
				document.tongquat.find2.disabled=true;
				document.tongquat.find3.disabled=true;
				document.tongquat.find4.disabled=true;
				document.tongquat.find5.disabled=true;
				document.tongquat.find6.disabled=true;
				document.tongquat.find7.disabled=true;
				document.tongquat.find8.disabled=true;
				document.tongquat.find9.disabled=true;
				document.tongquat.find10.disabled=true;
			}
			if(vTERMNO == 1){
				document.getElementById('CURMIN1').readOnly=false;
				document.getElementById('INTRATE1').readOnly=false;
				document.getElementById('INTCODE1').readOnly=false;
				document.getElementById('PRDCODE1').readOnly=false;
				
				document.getElementById('CURMIN2').readOnly='readOnly';
				document.getElementById('INTRATE2').readOnly='readOnly';
				document.getElementById('INTCODE2').readOnly='readOnly';
				document.getElementById('PRDCODE2').readOnly='readOnly';
				
				document.getElementById('CURMIN3').readOnly='readOnly';
				document.getElementById('INTRATE3').readOnly='readOnly';
				document.getElementById('INTCODE3').readOnly='readOnly';
				document.getElementById('PRDCODE3').readOnly='readOnly';
				
				document.getElementById('CURMIN4').readOnly='readOnly';
				document.getElementById('INTRATE4').readOnly='readOnly';
				document.getElementById('INTCODE4').readOnly='readOnly';
				document.getElementById('PRDCODE4').readOnly='readOnly';
				
				document.getElementById('CURMIN5').readOnly='readOnly';
				document.getElementById('INTRATE5').readOnly='readOnly';
				document.getElementById('INTCODE5').readOnly='readOnly';
				document.getElementById('PRDCODE5').readOnly='readOnly';
				
				//
				document.getElementById('CURMIN2').value='';
				document.getElementById('INTRATE2').value='';
				document.getElementById('INTCODE2').value='';
				document.getElementById('PRDCODE2').value='';
				
				document.getElementById('CURMIN3').value='';
				document.getElementById('INTRATE3').value='';
				document.getElementById('INTCODE3').value='';
				document.getElementById('PRDCODE3').value='';
				
				document.getElementById('CURMIN4').value='';
				document.getElementById('INTRATE4').value='';
				document.getElementById('INTCODE4').value='';
				document.getElementById('PRDCODE4').value='';
				
				document.getElementById('CURMIN5').value='';
				document.getElementById('INTRATE5').value='';
				document.getElementById('INTCODE5').value='';
				document.getElementById('PRDCODE5').value='';
				//
				
				document.tongquat.find1.disabled=false;
				document.tongquat.find2.disabled=false;
				document.tongquat.find3.disabled=true;
				document.tongquat.find4.disabled=true;
				document.tongquat.find5.disabled=true;
				document.tongquat.find6.disabled=true;
				document.tongquat.find7.disabled=true;
				document.tongquat.find8.disabled=true;
				document.tongquat.find9.disabled=true;
				document.tongquat.find10.disabled=true;
			}
			if(vTERMNO == 2){
				document.getElementById('CURMIN1').readOnly=false;
				document.getElementById('INTRATE1').readOnly=false;
				document.getElementById('INTCODE1').readOnly=false;
				document.getElementById('PRDCODE1').readOnly=false;
				
				document.getElementById('CURMIN2').readOnly=false;
				document.getElementById('INTRATE2').readOnly=false;
				document.getElementById('INTCODE2').readOnly=false;
				document.getElementById('PRDCODE2').readOnly=false;
				
				document.getElementById('CURMIN3').readOnly='readOnly';
				document.getElementById('INTRATE3').readOnly='readOnly';
				document.getElementById('INTCODE3').readOnly='readOnly';
				document.getElementById('PRDCODE3').readOnly='readOnly';
				
				document.getElementById('CURMIN4').readOnly='readOnly';
				document.getElementById('INTRATE4').readOnly='readOnly';
				document.getElementById('INTCODE4').readOnly='readOnly';
				document.getElementById('PRDCODE4').readOnly='readOnly';
				
				document.getElementById('CURMIN5').readOnly='readOnly';
				document.getElementById('INTRATE5').readOnly='readOnly';
				document.getElementById('INTCODE5').readOnly='readOnly';
				document.getElementById('PRDCODE5').readOnly='readOnly';
				
				//
				document.getElementById('CURMIN3').value='';
				document.getElementById('INTRATE3').value='';
				document.getElementById('INTCODE3').value='';
				document.getElementById('PRDCODE3').value='';
				
				document.getElementById('CURMIN4').value='';
				document.getElementById('INTRATE4').value='';
				document.getElementById('INTCODE4').value='';
				document.getElementById('PRDCODE4').value='';
				
				document.getElementById('CURMIN5').value='';
				document.getElementById('INTRATE5').value='';
				document.getElementById('INTCODE5').value='';
				document.getElementById('PRDCODE5').value='';
				//
				
				document.tongquat.find1.disabled=false;
				document.tongquat.find2.disabled=false;
				document.tongquat.find3.disabled=false;
				document.tongquat.find4.disabled=false;
				document.tongquat.find5.disabled=true;
				document.tongquat.find6.disabled=true;
				document.tongquat.find7.disabled=true;
				document.tongquat.find8.disabled=true;
				document.tongquat.find9.disabled=true;
				document.tongquat.find10.disabled=true;
			}
			if(vTERMNO == 3){
				document.getElementById('CURMIN1').readOnly=false;
				document.getElementById('INTRATE1').readOnly=false;
				document.getElementById('INTCODE1').readOnly=false;
				document.getElementById('PRDCODE1').readOnly=false;
				
				document.getElementById('CURMIN2').readOnly=false;
				document.getElementById('INTRATE2').readOnly=false;
				document.getElementById('INTCODE2').readOnly=false;
				document.getElementById('PRDCODE2').readOnly=false;
				
				document.getElementById('CURMIN3').readOnly=false;
				document.getElementById('INTRATE3').readOnly=false;
				document.getElementById('INTCODE3').readOnly=false;
				document.getElementById('PRDCODE3').readOnly=false;
				
				document.getElementById('CURMIN4').readOnly='readOnly';
				document.getElementById('INTRATE4').readOnly='readOnly';
				document.getElementById('INTCODE4').readOnly='readOnly';
				document.getElementById('PRDCODE4').readOnly='readOnly';
				
				document.getElementById('CURMIN5').readOnly='readOnly';
				document.getElementById('INTRATE5').readOnly='readOnly';
				document.getElementById('INTCODE5').readOnly='readOnly';
				document.getElementById('PRDCODE5').readOnly='readOnly';
				
				//
				document.getElementById('CURMIN4').value='';
				document.getElementById('INTRATE4').value='';
				document.getElementById('INTCODE4').value='';
				document.getElementById('PRDCODE4').value='';
				
				document.getElementById('CURMIN5').value='';
				document.getElementById('INTRATE5').value='';
				document.getElementById('INTCODE5').value='';
				document.getElementById('PRDCODE5').value='';
				//
				
				document.tongquat.find1.disabled=false;
				document.tongquat.find2.disabled=false;
				document.tongquat.find3.disabled=false;
				document.tongquat.find4.disabled=false;
				document.tongquat.find5.disabled=false;
				document.tongquat.find6.disabled=false;
				document.tongquat.find7.disabled=true;
				document.tongquat.find8.disabled=true;
				document.tongquat.find9.disabled=true;
				document.tongquat.find10.disabled=true;
			}
			if(vTERMNO == 4){
				document.getElementById('CURMIN1').readOnly=false;
				document.getElementById('INTRATE1').readOnly=false;
				document.getElementById('INTCODE1').readOnly=false;
				document.getElementById('PRDCODE1').readOnly=false;
				
				document.getElementById('CURMIN2').readOnly=false;
				document.getElementById('INTRATE2').readOnly=false;
				document.getElementById('INTCODE2').readOnly=false;
				document.getElementById('PRDCODE2').readOnly=false;
				
				document.getElementById('CURMIN3').readOnly=false;
				document.getElementById('INTRATE3').readOnly=false;
				document.getElementById('INTCODE3').readOnly=false;
				document.getElementById('PRDCODE3').readOnly=false;
				
				document.getElementById('CURMIN4').readOnly=false;
				document.getElementById('INTRATE4').readOnly=false;
				document.getElementById('INTCODE4').readOnly=false;
				document.getElementById('PRDCODE4').readOnly=false;
				
				document.getElementById('CURMIN5').readOnly='readOnly';
				document.getElementById('INTRATE5').readOnly='readOnly';
				document.getElementById('INTCODE5').readOnly='readOnly';
				document.getElementById('PRDCODE5').readOnly='readOnly';
				
				//
				document.getElementById('CURMIN5').value='';
				document.getElementById('INTRATE5').value='';
				document.getElementById('INTCODE5').value='';
				document.getElementById('PRDCODE5').value='';
				//
				
				document.tongquat.find1.disabled=false;
				document.tongquat.find2.disabled=false;
				document.tongquat.find3.disabled=false;
				document.tongquat.find4.disabled=false;
				document.tongquat.find5.disabled=false;
				document.tongquat.find6.disabled=false;
				document.tongquat.find7.disabled=false;
				document.tongquat.find8.disabled=false;
				document.tongquat.find9.disabled=true;
				document.tongquat.find10.disabled=true;
			}
			if(vTERMNO == 5){
				document.getElementById('CURMIN1').readOnly=false;
				document.getElementById('INTRATE1').readOnly=false;
				document.getElementById('INTCODE1').readOnly=false;
				document.getElementById('PRDCODE1').readOnly=false;
				
				document.getElementById('CURMIN2').readOnly=false;
				document.getElementById('INTRATE2').readOnly=false;
				document.getElementById('INTCODE2').readOnly=false;
				document.getElementById('PRDCODE2').readOnly=false;
				
				document.getElementById('CURMIN3').readOnly=false;
				document.getElementById('INTRATE3').readOnly=false;
				document.getElementById('INTCODE3').readOnly=false;
				document.getElementById('PRDCODE3').readOnly=false;
				
				document.getElementById('CURMIN4').readOnly=false;
				document.getElementById('INTRATE4').readOnly=false;
				document.getElementById('INTCODE4').readOnly=false;
				document.getElementById('PRDCODE4').readOnly=false;
				
				document.getElementById('CURMIN5').readOnly=false;
				document.getElementById('INTRATE5').readOnly=false;
				document.getElementById('INTCODE5').readOnly=false;
				document.getElementById('PRDCODE5').readOnly=false;
				
				document.tongquat.find1.disabled=false;
				document.tongquat.find2.disabled=false;
				document.tongquat.find3.disabled=false;
				document.tongquat.find4.disabled=false;
				document.tongquat.find5.disabled=false;
				document.tongquat.find6.disabled=false;
				document.tongquat.find7.disabled=false;
				document.tongquat.find8.disabled=false;
				document.tongquat.find9.disabled=false;
				document.tongquat.find10.disabled=false;
			}
		}else{
			document.getElementById('TERMNO').value='';	
		}
	}